<table id="doc-datagrid-table4" data-toggle="datagrid" data-options="{
    columns: [{name:'id', width:'50', label:'ID',align:'center'},{name:'type', width:'50', label:'类型',align:'center'},{name:'name', width:'200', label:'名称',align:'center'}, {name:'type', width:'120', label:'类型',align:'center'}, {name:'src', label:'图片',align:'center'}, {name:'action', label:'操作',align:'center'}],
    dataUrl: '<?php echo \application\Comm\Func::createUrl('housetag/listdo')?>',
    fullGrid: true,
    paging: {pageSize:5, selectPageSize:'10,20', pageCurrent:1, showPagenum:5},
}">

</table>
<script>
    function do_add($obj){
        $id = $obj.attr("data-id")
        $img = $obj.attr("data-img")
        $title = $obj.attr("data-title")
        $obj.parent().html('已添加');
        $("#housetag_list").append('<span class="img-list" id="img'+$id+'" style="padding: 1px;margin: 1px;"><img title="'+$title+'" alt="'+$title+'" width="50" src="'+$img+'"><input type="hidden" name="info[housetag][]" value="'+$id+'"></span>')
        do_remove()
    }

    function do_remove()
    {
        $(".img-list").click(function(){
            $(this).remove();
        })
    }
</script>